home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’94 / [√] Distribution Restricted! / Christian Ruse / Fourier Paper + Apps / nih-image154_source.sea / V1.54 Source / Globals.p < prev    next >
Text File  |  1994-01-31  |  38KB  |  1,140 lines

  1. unit Globals;
  2.  
  3. {Global declarations for Image program.}
  4.  
  5. interface
  6.  
  7.     uses
  8.         QuickDraw, Palettes, PrintTraps;
  9.  
  10.     const
  11.         Version = 154;
  12.  
  13.         UsingFPU = false; {If true, select 68881/68882 in Compile Options dialog box.}
  14.  
  15.         AppleMenu = 128;
  16.  
  17.         FileMenu = 129;
  18.         NewItem = 1;
  19.         OpenItem = 2;
  20.         ImportItem = 3;
  21.         CloseItem = 5;
  22.         SaveItem = 6;
  23.         SaveAsItem = 7;
  24.         ExportItem = 8;
  25.         SaveScreenItem = 9;
  26.         RecordPreferencesItem = 11;
  27.         RevertItem = 12;
  28.         DuplicateItem = 13;
  29.         GetInfoItem = 14;
  30.         AcquireItem = 16;
  31.         PlugInExportItem = 17;
  32.         SetHalftoneItem = 19;
  33.         PageSetupItem = 20;
  34.         PrintItem = 21;
  35.         QuitItem = 23;
  36.  
  37.         AcquireMenu = 42; {Sub Menu}
  38.  
  39.         ExportMenu = 44; {Sub Menu}
  40.  
  41.         EditMenu = 130;
  42.         UndoItem = 1;
  43.         CutItem = 3;
  44.         CopyItem = 4;
  45.         PasteItem = 5;
  46.         ClearItem = 6;
  47.         FillItem = 8;
  48.         InvertItem = 9;
  49.         DrawBoundaryItem = 10;
  50.         DrawScaleItem = 11;
  51.         SelectAllItem = 13;
  52.         ScaleAndRotateItem = 14;
  53.         RotateLeftItem = 16;
  54.         RotateRightItem = 17;
  55.         FlipVerticalItem = 18;
  56.         FlipHorizontalItem = 19;
  57.         UnzoomItem = 21;
  58.         ShowClipboardItem = 22;
  59.  
  60.         OptionsMenu = 131;
  61.         GrayscaleItem = 1;
  62.         ColorTablesItem = 2;
  63.         LutOptionsItem = 3;
  64.         PreferencesItem = 9;
  65.         PlotOptionsItem = 10;
  66.         ScaleToFitItem = 11;
  67.         ThresholdItem = 12;
  68.         SliceItem = 13;
  69.         PropagateItem = 14;
  70.  
  71.         FontMenu = 32; {Sub Menu}
  72.  
  73.         SizeMenu = 33; {Sub Menu}
  74.  
  75.         StyleMenu = 34; {Sub Menu}
  76.         LeftItem = 8;
  77.         CenterItem = 9;
  78.         RightItem = 10;
  79.         NoBackgroundItem = 12;
  80.         WithBackgroundItem = 13;
  81.  
  82.         ColorTablesMenu = 41; {Sub Menu}
  83.         SystemPaletteItem = 1;
  84.         Pseudo20Item = 2;
  85.         Pseudo32Item = 3;
  86.         RainbowItem = 4;
  87.         Fire1Item = 5;
  88.         Fire2Item = 6;
  89.         IceItem = 7;
  90.         GraysItem = 8;
  91.         SpectrumItem = 9;
  92.  
  93.         PropagateMenu = 38;   {Sub Menu}
  94.         LUTItem = 1;
  95.         SpatialItem = 2;
  96.         DensityItem = 3;
  97.         AllItem = 4;
  98.  
  99.         EnhanceMenu = 132;
  100.         SmoothItem = 1;
  101.         SharpenItem = 2;
  102.         ShadowItem = 3;
  103.         EdgeDetectItem = 4;
  104.         ReduceNoiseItem = 5;
  105.         DitherItem = 6;
  106.         ConvolveItem = 7;
  107.         FilterItem = 8;
  108.         BinaryItem = 10;
  109.         ConstMathItem = 11;
  110.         ImageMathItem = 12;
  111.         BackgroundItem = 13;
  112.         ApplyItem = 14;
  113.         EnhanceItem = 15;
  114.         EqualizeItem = 16;
  115.         FixColorsItem = 17;
  116.  
  117.         FilterMenu = 43; {Sub Menu}
  118.  
  119.         BinaryMenu = 35; {Sub Menu}
  120.         MakeBinaryItem = 1;
  121.         ErosionItem = 3;
  122.         DilationItem = 4;
  123.         OpeningItem = 5;
  124.         ClosingItem = 6;
  125.         SetCountItem = 7;
  126.         IterationsItem = 8;
  127.         OutlineItem = 10;
  128.         SkeletonizeItem = 11;
  129.  
  130.         ArithmeticMenu = 37; {Sub Menu}
  131.         AddItem = 1;
  132.         SubtractItem = 2;
  133.         MultiplyItem = 3;
  134.         DivideItem = 4;
  135.         LogItem = 5;
  136.  
  137.         BackgroundMenu = 40; {Sub Menu}
  138.         HorizontalItem = 1;
  139.         VerticalItem = 2;
  140.         Sub2DItem = 3;
  141.         RemoveStreaksItem = 4;
  142.         FasterItem = 6;
  143.         RadiusItem = 7;
  144.  
  145.         AnalyzeMenu = 133;
  146.         MeasureItem = 1;
  147.         AnalyzeItem = 2;
  148.         ShowItem = 3;
  149.         HistogramItem = 4;
  150.         PlotItem = 5;
  151.         PlotSurfaceItem = 6;
  152.         OptionsItem = 7;
  153.         SetScaleItem = 9;
  154.         CalibrateItem = 10;
  155.         RedoItem = 11;
  156.         DeleteItem = 12;
  157.         ResetItem = 13;
  158.         RestoreItem = 14;
  159.         MarkItem = 15;
  160.  
  161.         SpecialMenu = 140;
  162.         StartItem = 1;
  163.         AverageItem = 2;
  164.         SaveBlankFieldItem = 3;
  165.         VideoControlItem = 4;
  166.         PhotoModeItem = 5;
  167.         LoadMacrosItem = 7;
  168.         FirstMacroItem = 9;
  169.  
  170.         StacksMenu = 141;
  171.         StackFromWindowsItem = 1;
  172.         WindowsFromStackItem = 2;
  173.         AddSliceItem = 3;
  174.         DeleteSliceItem = 4;
  175.         NextSliceItem = 5;
  176.         PreviousSliceItem = 6;
  177.         MakeMovieItem = 8;
  178.         CaptureFramesItem = 9;
  179.         AnimateItem = 10;
  180.         AverageSlicesItem = 11;
  181.         MakeMontageItem = 12;
  182.         CaptureColorItem = 14;
  183.         RGBToColorItem = 15;
  184.         ColorToRGBItem = 16;
  185.         RGBToHSVItem = 17;
  186.         ProjectItem = 19;
  187.         ResliceItem = 20;
  188.         ResliceOptionsItem = 21;
  189.  
  190.         WindowsMenu = 138;
  191.         NextImageItem = 1;
  192.         StackImagesItem = 2;
  193.         TileImagesItem = 3;
  194.         PasteControlItem = 4;
  195.         SelectToolsItem = 6;
  196.         SelectGrayMapItem = 7;
  197.         SelectLutItem = 8;
  198.         SelectValuesItem = 9;
  199.         SelectHistogramItem = 10;
  200.         SelectPlotItem = 11;
  201.         SelectResultsItem = 12;
  202.  
  203.         UserMenu = 139;
  204.  
  205.         TransferModeMenu = 200;  {Popup Menu in Paste Control window}
  206.         CopyModeItem = 1;
  207.         AndItem = 2;
  208.         OrItem = 3;
  209.         XorItem = 4;
  210.         ReplaceItem = 5;
  211.         BlendItem = 6;
  212.  
  213.         LineToolMenu = 201;
  214.         StraightItem = 1;
  215.         SegmentedItem = 2;
  216.         FreehandItem = 3;
  217.  
  218.         ImageMathOpsMenu = 202;
  219.         ImageListMenu = 203;
  220.         UnitsMenu = 204;
  221.  
  222.         InvertID = 1;
  223.         HighLightID = 2;
  224.         OscillatingID = 3;
  225.         TriggerID = 4;
  226.         BlindID = 5;
  227.         FirstChannelID = 7;
  228.         OffsetID = 13;
  229.         GainID = 14;
  230.         ResetID = 15;
  231.         OffsetUpID = 16;
  232.         OffsetDownID = 17;
  233.         GainUpID = 18;
  234.         GainDownID = 19;
  235.         SyncID = 20;
  236.  
  237.         MinFree = 125000;
  238.         HeaderSize = 512;
  239.         TiffDirSize = 256;
  240.         MaxLine = 4096;
  241.         tleft = 36;
  242.         ttop = 40;
  243.         twidth = 44;
  244.         tmiddle = 22;
  245.         theight = 277;
  246.         gmleft = 2;
  247.         gmtop = 338;
  248.         gmwidth = 78;
  249.         gmheight = 118;
  250.         gmRectLeft = 7;
  251.         gmRectTop = 6;
  252.         gmRectRight = 71;
  253.         gmRectBottom = 70;
  254.         gmSlideWidth = 68;
  255.         gmSlideHeight = 7;
  256.         gmSlide1Offset = 8;
  257.         gmSlide2Offset = 19;
  258.         gmIconWidth = 17;
  259.         gmIconHeight = 14;
  260.         gmIconOffset = 31;
  261.         gmIcon1Left = 17;
  262.         gmIcon2Left = 46;
  263.         cleft = 2;
  264.         ctop = 40;
  265.         cwidth = 30;
  266.         rwidth = 200;
  267.         rheight = 225;
  268.         hleft = 220;
  269.         hwidth = 256;
  270.         hheight = 120;
  271.         pcwidth = 186;
  272.         pcheight = 85;
  273.         MaxPseudoColors = 32;
  274.         MaxPseudoColorsLessOne = 31;
  275.         PicKind = 88;
  276.         HistoKind = 89;
  277.         ProfilePlotKind = 90;
  278.         LUTKind = 91;
  279.         MapKind = 92;
  280.         ToolKind = 93;
  281.         ValuesKind = 94;
  282.         CalibrationPlotKind = 95;
  283.         PasteControlKind = 96;
  284.         ResultsKind = 97;
  285.         TextKind = 98;
  286.         IOErrorID = 400;
  287.         AboutID = 256;
  288.         VersItem = 2;
  289.         MemItem = 3;
  290.         StackSize = 40000;
  291.         ToolFont = 249;      {Bits 7-14 of font resource ID(31884) }
  292.         WindowsMenuItems = 13;       {Items in Windows menu before images - nTextWindows}
  293.         WhiteIndex = 0;
  294.         BlackIndex = 255;
  295.         OvalSize = 15;
  296.         LinesLeft = 13;
  297.         LinesRight = 40;
  298.         nLinetypes = 6;
  299.         CheckMarkChar = 65;
  300.         TxPlain = 1;
  301.         TxBold = 2;
  302.         TxItalic = 3;
  303.         TxUnderLine = 4;
  304.         TxOutLine = 5;
  305.         TxShadow = 6;
  306.         FileID8 = 'IPICIMAG';
  307.         DefaultBufferSize = 307200; {Enough for 640x480 image}
  308.         PickerCursorID = 111;
  309.         LUTCursorID = 112;
  310.         gmCursorID = 113;
  311.         GrabberCursorID = 114;
  312.         PencilCursorID = 115;
  313.         CrossCursorID = 117;
  314.         CrossCursorPlusID = 118;
  315.         CrossCursorMinusID = 119;
  316.         BucketCursorID = 120;
  317.         GlassCursorPlusID = 121;
  318.         GlassCursorMinusID = 122;
  319.         WandCursorID = 123;
  320.         WandPlusCursorID = 124;
  321.         WandMinusCursorID = 125;
  322.         TextCursorID = 126;
  323.         EraserCursorID = 127;
  324.         SprayCursorID = 128;
  325.         BrushCursorID = 129;
  326.         AppleDefaultCLUT = 8;
  327.         SpectrumCLUT = 200;
  328.         KlutzID = 200;
  329.         PixelPaintID = 999; {Used for PixelPaint and Canvas CLUTs}
  330.         GhostWindow = $A84;
  331.         GrayRgnGlobal = $9EE;
  332.         MBarHeight = $BAA;
  333.         MaxPics = 250;
  334.         FirstExtraColorsEntry = 1;
  335.         MaxExtraColors = 6;
  336.         MaxExtraPlus2 = 8;
  337.         ExtraColorsHeight = 10;
  338.         MyMaxLong = 2000000000;
  339.         MaxTextBufSize = 32700;
  340.         MaxMaxRegions = 8000;
  341.         MaxStandards = 20;
  342.         BadReal = 808080.0;
  343.         NoValue = -808080.0;
  344.         TabSpacing = 12;
  345.         MaxPolyVertices = 4000;
  346.         pi = 3.1415926535898;
  347.         ValuesVStart = 11;
  348.         ValuesHStart = 4;
  349.     {TIFF Constants}
  350.         short = 3;
  351.         long = 4;
  352.         NewSubfileType = 254;
  353.         ImageWidth = 256;
  354.         ImageLength = 257;
  355.         BitsPerSample = 258;
  356.         Compression = 259;
  357.         PhotoInterp = 262;
  358.         StripOffsets = 273;
  359.         SamplesPerPixel = 277;
  360.         RowsPerStrip = 278;
  361.         StripByteCount = 279;
  362.         XResolution = 282;
  363.         YResolution = 283;
  364.         ResolutionUnit = 296;
  365.         ColorMapTag = 320;
  366.         ImageHdrTag = -22222; {43314}
  367.         TiffFillerSize = 67;
  368.         RoiHandleSize = 5;
  369.         CancelResetID = 3;
  370.         npcItems = 7;
  371. {Blend = 32;}
  372. {Transparent = 36;}
  373.         LeftArrow = 28;
  374.         RightArrow = 29;
  375.         UpArrow = 30;
  376.         DownArrow = 31;
  377.         hPicOffset = 8;
  378.         vPicOffset = 16;
  379.         fgRowBytes = 1024;
  380.         FunctionKey = 16;
  381.  
  382.         MaxMacroSize = 15000;
  383.         MaxMacroFileSize = 30000;
  384.         MaxSymbols = 500;
  385.         MaxStackSize = 150;
  386.         MaxMacros = 100;
  387.         SymbolSize = 12;
  388.         BlankSymbol = '            ';
  389.         StackOverflow = 'Stack overflow';
  390.  
  391.         MaxPicSize = 16383;
  392.         ScrollBarWidth = 15;
  393.         PrefsName = 'Image Prefs';
  394.         StraightChar = 97;
  395.         SegmentedChar = 98;
  396.         FreehandChar = 99;
  397.         MaxSlices = 256;
  398.         HomeKey = 1;
  399.         EndKey = 4;
  400.         PageUp = 11;
  401.         PageDown = 12;
  402.         osEvt = 15;
  403.         Pseudo20ID = 1001;
  404.         Pseudo32ID = 1002;
  405.         RainbowID = 1003;
  406.         Fire1ID = 1004;
  407.         Fire2ID = 1005;
  408.         IceID = 1006;
  409.         GraysID = 1007;
  410.         MaxColor = 15000;
  411.         MaxCoordinates = 10000;
  412.         DefaultLG3DacLow = 50;    {0.39V}
  413.         DefaultLG3DacHigh = 150; {1.18V}
  414.         MaxTextWindows = 10;
  415.  
  416.  
  417.     type
  418.         UnsignedByte = 0..255;
  419.         LineType = packed array[0..MaxLine] of UnsignedByte;
  420.         LinePtr = ^LineType;
  421.         rLineType = array[0..MaxLine] of real;
  422.         rLinePtr = ^rLineType;
  423.         RealLine = array[1..MaxLine] of real;
  424.         ClutTable = packed array[0..255] of integer;
  425.         ColorArray = packed array[0..MaxPseudoColorsLessOne] of byte;
  426.         LutArray = packed array[0..255] of byte;
  427.         PicType = (pdp11, NewPicture, normal, PictFile, Leftover, imported, FrameGrabberType, NullPicture, BlankField, TiffFile, InvertedTIFF, FourBitTIFF, ScionType, PicsFile);
  428.         LUTModeType = (PseudoColor, OldAppleDefault, OldSpectrum, GrayScale, ColorLut, CustomGrayscale);
  429.         ColorTableType = (CustomTable, AppleDefault, Pseudo20, Pseudo32, Rainbow, Fire1, Fire2, Ice, Grays, Spectrum);
  430.         ExtraColorsArray = array[1..MaxExtraColors] of rgbColor;
  431.         MyCSpecArray = array[0..255] of ColorSpec;
  432.         CoefficientArray = array[1..6] of double;
  433.         CurveFitType = (StraightLine, Poly2, Poly3, Poly4, Poly5, ExpoFit, PowerFit, LogFit, RodbardFit, SpareFit1, SpareFit2, UncalibratedOD);
  434.         UnitsType = (Nanometers, Micrometers, Millimeters, Centimeters, Meters, Kilometers, Inches, Feet, Miles, Pixels, OtherUnits);
  435.         UnitType = string[11];
  436.         FileDepthType = (EightBits, SixteenBitsUnsigned, SixteenBitsSigned);
  437.         RoiTypeType = (PolygonRoi, RectRoi, OvalRoi, LineRoi, FreeLineRoi, SegLineRoi, NoRoi, FreehandRoi);
  438.  
  439.         PicHeader = record
  440.                 FileID: packed array[1..8] of char; {8  8}
  441.                 hnlines: integer;                    {2  10}
  442.                 hPixelsPerLine: integer;        {2  12}
  443.                 hversion: integer;                   {2  14}
  444.                 hOldLutMode: LutModeType;    {2  16}
  445.                 hOldnColors: integer;                {2  18}
  446.                 hr, hg, hb: ColorArray;              {96 114}
  447.                 hOldColorStart: integer;             {2  116}
  448.                 hColorWidth: integer;                 {2  118}
  449.                 hExtraColors: ExtraColorsArray;   {36 154}
  450.                 hnExtraColors: integer;              {2  156}
  451.                 hForegroundIndex: integer;     {2  158}
  452.                 hBackgroundIndex: integer;      {2  160}
  453.                 hXSpatialScale: double;        {8  168}
  454.                 Unused2: integer;                    {2  170}
  455.                 Unused3: integer;                    {2  172}
  456.                 hUnitsID: integer;                   {2  174}
  457.                 hp1x, hp1y, hp2x, hp2y: integer;     {8  182}
  458.                 hfit: CurveFitType;                  {2  184}
  459.                 hnCoefficients: integer;           {2  186}
  460.                 hCoeff: CoefficientArray;         {48 234}
  461.                 hUM: string[15];                   {16 250}
  462.                 UnusedBoolean: boolean;          {1  251}
  463.                 hBinaryPic: boolean;               {1  252}
  464.                 hSliceStart: integer;           {2 254}
  465.                 hSliceEnd: integer;              {2  256}
  466.                 hScaleMagnification: real;   {4  260}
  467.                 hNSlices: integer;                 {2 262}
  468.                 hSliceSpacing: real;          {4 266}
  469.                 hCurrentSlice: integer;        {2 268}
  470.                 hLoopTime: real;                   {4  272}
  471.                 hPixelAspectRatio: real;       {4  276}
  472.                 hColorStart: integer;             {2  278}
  473.                 hColorEnd: integer;               {2  280}
  474.                 hnColors: integer;                  {2  282}
  475.                 hFill1, hFill2: RGBColor;    {12  294}
  476.                 hTable: ColorTableType;       {1  295}
  477.                 hLutMode: LutModeType;      {1  296}
  478.                 hInvertedTable: boolean;      {1  297}
  479.                 hZeroClip: boolean;               {1  298}
  480.                 hXUnit: string[11];            {12 310}
  481.                 UnusedBytes: packed array[1..202] of byte;
  482.             end;
  483.  
  484.         StackInfoRec = record
  485.                 nSlices: integer;
  486.                 CurrentSlice: integer;
  487.                 PicBaseH: array[1..MaxSlices] of handle;
  488.                 SliceSpacing: real; {Pixels}
  489.                 LoopTime: real;
  490.             end;
  491.         StackInfoPtr = ^StackInfoRec;
  492.  
  493.         PaletteHeader = record
  494.                 pID: packed array[1..4] of char;  {4  4}
  495.                 pVersion: integer;                              {2  6}
  496.                 pnColors: integer;                              {2  8}
  497.                 pColorStart: integer;                         {2  10}
  498.                 pColorEnd: integer;                            {2  12}
  499.                 pFill1: rgbColor;                               {6  18}
  500.                 pFill2: rgbColor;                               {6  24}
  501.                 pUnused: array[1..4] of integer;     {8  32}
  502.             end;
  503.  
  504.         RoiHeader = record
  505.                 rID: packed array[1..4] of char;  {4   4}
  506.                 rVersion: integer;                              {2   6}
  507.                 rRoiType: RoiTypeType;                    {2   8}
  508.                 rRoiRect: rect;                                   {8   16}
  509.                 rNCoordinates: integer;                     {2   18}
  510.                 rX1, rY1, rX2, rY2: real;                 {16 34}
  511.                 rLineWidth: integer;                          {2   36}
  512.                 rUnused: array[1..14] of integer;    {28 64}
  513.             end;
  514.  
  515.         PicInfo = record
  516.                 nlines, PixelsPerLine: integer;
  517.                 ImageSize: LongInt;
  518.                 BytesPerRow: integer;
  519.                 PicBaseAddr: ptr;
  520.                 PicBaseHandle: handle;
  521.                 osPort: cGrafPtr;         {Offscreen Port}
  522.                 PicRect: rect;
  523.                 RoiRect: rect;
  524.                 roiRgn: rgnHandle;
  525.                 RoiType: RoiTypeType;
  526.                 SrcRect: rect;
  527.                 wrect: rect;
  528.                 initwrect: rect;
  529.                 savewrect, SaveSrcRect: rect;
  530.                 SaveMagnification: extended;
  531.                 savehloc, savevloc: integer;  {Old window location in global coordinates}
  532.                 RoiShowing: boolean;
  533.                 title: string[31];
  534.                 NewPic: boolean;
  535.                 Magnification: extended;
  536.                 vref: integer;
  537.                 PictureType: PicType;
  538.                 wptr: WindowPtr;
  539.                 PicNum, PidNum: integer;
  540.                 ScaleToFitWindow: boolean;
  541.                 Changes: boolean;
  542.                 RedLUT, GreenLUT, BlueLUT: LutArray;
  543.                 nColors: integer;
  544.                 ColorStart, ColorEnd, SaveColorStart, SaveColorEnd: LongInt;
  545.                 FillColor1, FillColor2, SaveFill1, SaveFill2: RGBColor;
  546.                 LUTMode: LUTModeType;
  547.                 ColorTable: ColorTableType;
  548.                 InvertedColorTable: boolean;
  549.                 cTable: MyCSpecArray;
  550.                 IdentityFunction: boolean;
  551.                 PixMapSize: LongInt;
  552.                 xSpatialScale, ySpatialScale, PixelAspectRatio: extended;
  553.                 xUnit: UnitType;  {Someday there may be yUnit}
  554.                 UnitOfMeasure: string[15];
  555.                 HeaderOffset, ImageDataOffset, ColorMapOffset: LongInt;
  556.                 Fit: CurveFitType;
  557.                 nCoefficients: integer;
  558.                 Coefficient: CoefficientArray;
  559.                 DensityCalibrated, SpatiallyCalibrated: boolean;
  560.                 ZeroClip: boolean;
  561.                 BinaryPic: boolean;
  562.                 WindowState: (NormalWindow, TiledSmall, TiledSmallScaled, TiledBig, TiledBigScaled);
  563.                 Revertable: boolean;
  564.                 LX1, LY1, LX2, LY2, LAngle: real;
  565.                 StackInfo: StackInfoPtr;
  566.                 Thresholding: boolean;
  567.                 iVersion: integer;
  568.                 DataType: FileDepthType;
  569.                 AbsoluteMin, AbsoluteMax, CurrentMin, CurrentMax: LongInt;
  570.                 LittleEndian: boolean;
  571.                 DataH: handle;
  572.             end;
  573.  
  574.         InfoPtr = ^PicInfo;
  575.         ToolType = (MagnifyingGlass, SelectionTool, Grabber, OvalSelectionTool, Pencil, PolygonTool, Eraser, FreehandTool, Brush, LineTool, ruler, LUTTool, PaintBucket, TextTool, PlotTool, SprayCanTool, Wand, PickerTool, AngleTool, CrossHairTool);
  576.         OpType = (InvertOp, PaintOp, FrameOp, EraseOp, PasteOp, AddOp, SubtractOp, MultiplyOp, DivideOp);
  577.         ObjectType = (lineObj, oval, SelectionOval, Rectangle, SelectionRect, BrushObj);
  578.         FilterType = (WeightedAvg, UnweightedAvg, fsharpen, fshadow, EdgeDetect, ReduceNoise, dither, erosion, dilation, OutlineFilter, skeletonize);
  579.         rhptr = ^RgnHandle;
  580.         FlipRotateType = (RotateLeft, RotateRight, FlipVertical, FlipHorizontal);
  581.         TextBackType = (NoBack, WithBack);
  582.         HistogramType = array[0..255] of LongInt;
  583.         str4 = packed array[1..4] of char;
  584.         LookupTable = packed array[0..255] of UnsignedByte;
  585.         TextBufType = packed array[1..MaxTextBufSize] of char;
  586.         TextBufPtr = ^TextBufType;
  587.         StandardsArray = array[1..MaxStandards] of extended;
  588.         MeasurementTypes = (AreaM, MeanM, StdDevM, xyLocM, ModeM, LengthM, MajorAxisM, MinorAxisM, AngleM, IntDenM, MinMaxM, User1M, User2M);
  589.         TiffHdr = record
  590.                 ByteOrder: packed array[1..2] of char;
  591.                 Version: integer;
  592.                 FirstIFDOffset: LongInt;
  593.             end;
  594.         TiffEntry = record
  595.                 TagField: integer;
  596.                 ftype: integer;
  597.                 length: LongInt;
  598.                 offset: LongInt;
  599.             end;
  600.         pcItemType = (pcPopupMenu, pcCheckBox, pcButton);
  601.         WhatToImportType = (ImportTIFF, ImportMCID, ImportLUT, ImportText, ImportCustom);
  602.         FateTable = array[0..255] of integer;
  603.         SaveAsWhatType = (asTIFF, asPICT, asMacPaint, asPICS, AsPalette, AsOutline, AsRawData, SaveAsMCID);
  604.         ExportAsWhatType = (AsRaw, asMCID, asText, AsLUT, asMeasurements, asPlotValues, asHistogramValues, asCoordinates);
  605.  
  606.         RealArray = array[0..MaxMaxRegions] of real;
  607.         meanType = RealArray;
  608.         sdType = RealArray;
  609.         PixelCountType = array[0..MaxMaxRegions] of LongInt;
  610.         AreaType = RealArray;
  611.         modeType = RealArray;
  612.         IntegratedDensityType = RealArray;
  613.         idBackgroundType = RealArray;
  614.         xcenterType = RealArray;
  615.         ycenterType = RealArray;
  616.         MajorAxisType = RealArray;
  617.         MinorAxisType = RealArray;
  618.         orientationType = RealArray;
  619.         MinType = RealArray;
  620.         MaxType = RealArray;
  621.         plengthType = RealArray;
  622.         User1Type = RealArray;
  623.         User2Type = RealArray;
  624.  
  625.         meanPtr = ^meanType;
  626.         sdPtr = ^sdType;
  627.         PixelCountPtr = ^PixelCountType;
  628.         AreaPtr = ^AreaType;
  629.         modePtr = ^modeType;
  630.         IntegratedDensityPtr = ^IntegratedDensityType;
  631.         idBackgroundPtr = ^idBackgroundType;
  632.         xcenterPtr = ^xcenterType;
  633.         ycenterPtr = ^ycenterType;
  634.         MajorAxisPtr = ^MajorAxisType;
  635.         MinorAxisPtr = ^MinorAxisType;
  636.         orientationPtr = ^orientationType;
  637.         MinPtr = ^MinType;
  638.         MaxPtr = ^MaxType;
  639.         plengthPtr = ^plengthType;
  640.         User1Ptr = ^User1Type;
  641.         User2Ptr = ^User2Type;
  642.         SyncModeType = (NormalSync, SeparateSync, SyncOnGreen);
  643.  
  644.         TokenType = (NullT, MacroT, NewLineT, beginT, endT, Identifier, UnknownIdentifier, DoneT, LeftParen, {}
  645.             RightBracket, comma, colon, SemiColon, StringLiteral, NumericLiteral, VarT, IntegerT, RealT, BooleanT, CommandT,{}
  646.             FunctionT, ArrayT, AssignOp, ForT, ToT, DoT, IfT, ThenT, ElseT, whileT, repeatT, untilT, Variable, PlusOp,{}
  647.             MinusOp, MulOp, DivOp, eqOP, ltOp, gtOp, neOp, leOp, geOp, orOp, IntDivOp, modOp, andOp, NotOp, ProcedureT,{}
  648.             ProcIdT, TrueT, FalseT, RightParen, LeftBracket, StringT, StringVariable, {}
  649.             StringFunctionT, UserCommandT, UserFuncT, UserStrFuncT);
  650.         CommandType = (InvertLUTC, UserCodeC, MoveWindowC, AutoThresholdC, SetExportC, SubtractBackgroundC,{}
  651.             SetUser1C, SetUser2C, GetPlotDataC, PlotDataC, RequiresC, SetOptionsC, BufferC, GetSpacingC, SetSpacingC, {}
  652.             PropagateLutC, PropagateDensityC, PropagateSpatialC, SetCountC, ShowMsgC, UpdateLutC, SetCounterC, RedLutC,{}
  653.             GreenLutC, BlueLutC, SaveStateC, RestoreStateC, GetTimeC, SetScaleC, MakeLineC, PlotProfileC, ResliceC, CopyModeC,{}
  654.             TriggerC, AverageFramesC, AddSliceC, DeleteSliceC, MakeStackC, GetSliceC, nSlicesC, SelectSliceC, ChooseSliceC, {}
  655.             GetMouseC, SetMajorC, SetMinorC, TileC, rAreaC, rMeanC, rStdDevC, rAngleC, rXC, rYC, rLengthC, rMajorC, {}
  656.             rMinorC, rMinC, rMaxC, rUser1C, rUser2C, UpdateResultsC, rCountC, HistogramC, ChangeC, ExportC, PicNumC,{}
  657.             ScaleSelectionC, ScalingOptionsC, PutPixelC, ChoosePicC, WriteC, WritelnC,{}
  658.             SetPrecisionC, SetParticleSizeC, AdjustC, IgnoreC,{}
  659.             OutlineParticlesC, LabelC, IncludeC, AutoC, PlotXYZC, CalibratedC, cValueC, SameSizeC, GetColumnC, PutColumnC, {}
  660.             GetRowC, PutRowC, ShowResultsC, SetWidthC, ScaleMathC, InvertYC, AndC, OrC, XorC, BlendC, ReplaceC, AddC, SubC, {}
  661.             MulC, DivC, SetOptionC, GetResultsC, SetLabelsC, SetPlotScaleC, SetDimC, ColumnC, ChannelC, ShowPasteC, NullC,{}
  662.             RotateRC, RotateLC, FlipVC, FlipHC, CopyC, SelectC, ClearC, FillC, InvertC, FrameC, PasteC, KillC, RestoreC, AnalyzeC,{}
  663.             ConvolveC, NextC, MarkC, MeasureC, ThresholdC, ResetgmC, MakeBinC, DitherC, SmoothC, SharpenC, ShadowC, {}
  664.             TraceC, ReduceC, SetSliceC, RedirectC, WaitC, ResetmC, UndoC, SetForeC, SetBackC, ScaleC, HistoC, EnhanceC, {}
  665.             EqualizeC, ErodeC, DilateC, OutlineC, ThinC, AddConstC, MulConstC, RevertC, BeepC, NopC, MakeC, MakeOvalC, {}
  666.             MoveC, InsetC, MoveToC, LineToC, DrawTextC, DrawNumC, SetFontC, SetFontSizeC, SetTextC, GetPicSizeC, PutMsgC, {}
  667.             ExitC, GetRoiC, TruncC, RoundC, GetNumC, StartC, StopC, CaptureC, RandomC, MakeNewC, DrawScaleC, SetPaletteC, {}
  668.             GetPixelC, ButtonC, oddC, absC, sqrtC, sinC, cosC, expC, lnC, arctanC, sqrC, OpenC, ImportC, SetImportC, SetMinMaxC,{}
  669.             SetCustomC, nPicsC, SelectPicC, SetPicNameC, ApplyLutC, SetSizeC, SaveC, SaveAllC, SaveAsC, CopyResultsC, CloseC, {}
  670.             DisposeC, DisposeAllC, DupC, GetInfoC, PrintC, GetLineC, xCoordinatesC, yCoordinatesC, nCoordinatesC, GetStringC, {}
  671.             OpenSerialC, GetSerialC, PutSerialC, ChrC, OrdC, SetCursorC, TickCountC, ConcatC, SetVideoC, StringToNumC, AcquireC,{}
  672.             UndoSizeC, ScionC, FilterC, PhotoModeC, RGBToIndexedC, SurfacePlotC, SelectWindowC, NewTextWindowC, CaptureColorC,{}
  673.             GetThresholdC, AverageSlicesC, BitAndC, BitOrC, PidNumC, SortPaletteC, ProjectC, WindowTitleC, ScaleConvolutionsC,{}
  674.             ImageMathC, PasteLiveC, PidExistsC, PosC);
  675.         SymbolType = packed array[1..SymbolSize] of char;
  676.         VarType = (IntVar, RealVar, BooleanVar, StringVar);
  677.         SymTabRec = record
  678.                 Symbol: SymbolType;
  679.                 tType: TokenType;
  680.                 cType: CommandType;
  681.                 loc: integer;
  682.             end;
  683.         str255P = ^str255;
  684.         str255H = ^str255P;
  685.         StackRec = record
  686.                 SymbolTableIndex: integer;
  687.                 Value: extended;
  688.                 vType: VarType;
  689.                 StringH: str255H;
  690.             end;
  691.         MacrosRec = record
  692.                 Macros: packed array[0..MaxMacroSize] of char;
  693.                 SymbolTable: array[1..MaxSymbols] of SymTabRec;
  694.                 stack: array[1..MaxStackSize] of StackRec;
  695.                 aLine: LineType;
  696.             end;
  697.         MacrosPtr = ^MacrosRec;
  698.         rsMethodType = (Bilinear, NearestNeighbor);
  699.         TiffColorMapType = array[1..3] of array[0..255] of integer;
  700.         StackIFDType = record
  701.                 nEntries: integer; {2}
  702.                 TiffDir: array[1..6] of TiffEntry; {72}
  703.                 NextIFD: LongInt;  {4}
  704.             end;
  705.  
  706.         SettingsType = record
  707.                 sID: packed array[1..4] of char;
  708.                 sVersion: integer;
  709.                 sForegroundIndex, sBackgroundIndex: integer;
  710.                 sBrushHeight, sBrushWidth: integer;
  711.                 sSprayCanDiameter: integer;
  712.                 sLUTMode: LUTModeType;
  713.                 sOldColorStart: integer;
  714.                 sOldColorWidth: integer;
  715.                 sCurrentFontID: integer;
  716.                 sCurrentStyle: style;
  717.                 sCurrentSize: integer;
  718.                 sTextJust: integer;
  719.                 sTextBack: TextBackType;
  720.                 snExtraColors: integer;
  721.                 sExtraColors: ExtraColorsArray;
  722.                 sInvertVideo: boolean;
  723.                 sMeasurements: set of MeasurementTypes;
  724.                 sInvertPlots, sAutoScalePlots, sLinePlot, sDrawPlotLabels, sFixedSizePlot: boolean;
  725.                 sUnused1: packed array[1..12] of integer;
  726.                 sProfilePlotWidth, sProfilePlotHeight: integer;
  727.                 sFramesToAverage: integer;
  728.                 sNewPicWidth, sNewPicHeight: integer;
  729.                 sBufferSize: LongInt;
  730.                 sMaxScionWidth: integer;
  731.                 sThresholdToForeground, sNonThresholdToBackground: boolean;
  732.                 sVideoChannel: integer;
  733.                 sWhatToImport: WhatToImportType;
  734.                 sImportCustomWidth, sImportCustomHeight: integer;
  735.                 sImportCustomOffset: LongInt;
  736.                 sWandAutoMeasure, sWandAdjustAreas: boolean;
  737.                 sBinaryIterations: integer;
  738.                 sScaleArithmetic: boolean;
  739.                 sInvertPixelValues: boolean;
  740.                 sInvertYCoordinates: boolean;
  741.                 sFieldWidth, sPrecision: integer;
  742.                 sMinParticleSize, sMaxParticleSize: LongInt;
  743.                 sIgnoreParticlesTouchingEdge, sLabelParticles, sOutlineParticles, sIncludeHoles: boolean;
  744.                 sKernelsVRefNum: integer;
  745.                 sKernelsDirID: LongInt;
  746.                 sDefaultVRefNum: integer;
  747.                 sDefaultDirID: LongInt;
  748.                 sOscillatingMovies: boolean;
  749.                 sDriverHalftoning: boolean;
  750.                 sMaxMeasurements: integer;
  751.                 sImportCustomDepth: FileDepthType;
  752.                 sImportSwapBytes, sImportCalibrate, sImportAutoscale: boolean;
  753.                 sUnused2: packed array[1..12] of integer;
  754.                 sShowHeadings: boolean;
  755.         {Added with V1.40}
  756.                 sProfilePlotMin, sProfilePlotMax: real;
  757.                 sImportMin, sImportMax: real;
  758.                 sHighlightPixels: boolean;
  759.         {Added with V1.41}
  760.                 sBallRadius: integer;
  761.                 sFasterBackgroundSubtraction: boolean;
  762.                 sScaleConvolutions: boolean;
  763.        {Added with V1.42}
  764.                 sBinaryCount: integer;
  765.                 sColorTable: ColorTableType;
  766.                 sColorStart, sColorEnd: integer;
  767.                 sInvertedTable: boolean;
  768.        {Added with V1.44}
  769.                 sHalftoneFrequency, sHalftoneAngle: integer;
  770.                 sHalftoneDotFunction: boolean;
  771.        {Added with V1.46}
  772.                 sLG3DacLow, sLG3DacHigh: integer;
  773.       {Added with V1.47}
  774.                 sSyncMode: SyncModeType;
  775.       {Added with V1.49}
  776.                 sSwitchLUTOnSuspend: boolean;
  777.                 sVideoRateAveraging: boolean;
  778.       {Added with V1.50}
  779.                 sImportInvert: boolean;
  780.       {Added with V1.52}
  781.                 sTextCreator: packed array[1..4] of char;
  782.                 sUnused: array[1..10] of LongInt;
  783.             end;
  784.  
  785.         TiffInfoRec = record
  786.                 Width, Height: integer;
  787.                 BitsPerPixel: integer;
  788.                 ZeroIsBlack: boolean;
  789.                 OffsetToData, OffsetToColorMap, OffsetToImageHeader: LongInt;
  790.                 Resolution: extended;
  791.                 ResUnits: (tCentimeters, tInches, tNoUnits);
  792.                 NextIFD: LongInt;
  793.             end;
  794.  
  795.         TiffIFDTable = array[1..MaxSlices] of record
  796.                 iWidth, iHeight: integer;
  797.                 Offset: LongInt;
  798.                 Invert: boolean;
  799.             end;
  800.  
  801.         PaletteRecType = record
  802.                 NumberOfColors: integer;
  803.                 RedData: ColorArray;
  804.                 GreenData: ColorArray;
  805.                 BlueData: ColorArray;
  806.             end;
  807.  
  808.         ProjectionMethodType = (NearestPoint, BrightestPoint, MeanValue);
  809.         AxisType = (XAxis, YAxis, ZAxis);
  810.  
  811.         CoordinatesType = array[1..MaxCoordinates] of integer;
  812.         xCoordinatesPtr = ^CoordinatesType;
  813.         yCoordinatesPtr = ^CoordinatesType;
  814.         WhatToUndoType = (NothingToUndo, UndoEdit, UndoFlip, UndoRotate, UndoFilter, UndoPaste, UndoTransform, UndoClear, UndoMeasurement, UndoPoint, UndoZoom, UndoOutline, UndoSliceDelete, UndoFirstSliceDelete, UndoLUT);
  815.  
  816.         TextInfoRec = record
  817.                 TextWindowPtr: WindowPtr;
  818.                 TextLeft, TextTop, TextWidth, TextHeight: integer;
  819.                 hTextScrollBar, vTextScrollBar: ControlHandle;
  820.                 hTextPageSize, vTextPageSize: integer;
  821.                 TextTE: TEHandle;
  822.                 TextTitle: string[31];
  823.                 TextRefNum: integer;
  824.                 Changes, TooBig: boolean;
  825.                 WindowNum: integer;
  826.             end;
  827.         TextInfoPtr = ^TextInfoRec;
  828.  
  829.  
  830.     var
  831.         TraceInfo: str4;
  832.         finished: boolean;
  833.         trect, gmrect, MapRect, MapRect2, crect, HistoRect: rect;
  834.         gmSlide1, gmslide2, gmSlide1i, gmSlide2i, gmicon1, gmicon2: rect;
  835.         ToolWindow, MapWindow, LUTWindow, ValuesWindow, HistoWindow, PlotWindow, PasteControl: WindowPtr;
  836.         BuggyWatch: CursHandle;
  837.         cr, tab, BackSpace, eof: char;
  838.         CharCount: LongInt;
  839.         ScreenPort: GrafPtr;
  840.         CScreenPort: cGrafPtr;
  841.         ticks: LongInt;
  842.         MonoFunction: ClutTable;
  843.         Info: InfoPtr;
  844.         ToolCursor: array[ToolType] of Cursor;
  845.         PickerCursor, LUTCursor, gmCursor, CrossPlusCursor, CrossMinusCursor, GlassMinusCursor, watch, WandPlusCursor, WandMinusCursor: Cursor;
  846.         CurrentTool, PreviousTool, FirstTool, LastTool: ToolType;
  847.         ToolRect: array[ToolType] of rect;
  848.         ToolTime, LutTime: longInt;
  849.         nPics, nextPid: integer;
  850.         PicWindow: array[1..MaxPics] of WindowPtr;
  851.         ScreenWidth, ScreenHeight: integer;
  852.         ScreenBase: ptr;
  853.         ScreenRowBytes: LongInt;
  854.         Histogram: HistogramType;
  855.         HistogramSliceStart, HistogramSliceEnd: integer;
  856.         ForegroundIndex, BackgroundIndex: integer;
  857.         lines: array[1..nLineTypes] of rect;
  858.         CheckRect: rect;
  859.         LineWidth, LineIndex: integer;
  860.         StartOfLines: integer;
  861.         MaskRgn: RgnHandle;
  862.         PlotPICT: PicHandle;
  863.         PlotLeft, PlotTop, PlotWidth, PlotHeight, PlotPicNum: integer;
  864.         PlotMin, PlotMax, ActualPlotMin, ActualPlotMax: real;
  865.         PlotCount, PlotAvg: integer;
  866.         PlotData: rLinePtr;
  867.         PlotAngle, PlotScale: extended;
  868.         PlotStart: point;
  869.         PlotXUnits, PlotYUnits: string[15];
  870.         InvertPlots, AutoscalePlots, LinePlot, DrawPlotLabels, FixedSizePlot: boolean;
  871.         ProfilePlotMin, ProfilePlotMax: extended;
  872.         ProfilePlotWidth, ProfilePlotHeight: integer;
  873.         UndoBuf, ClipBuf, BigBuf: ptr;
  874.         ClipBufSize, UndoBufSize, BigBufSize: LongInt;
  875.         UndoInfoRec: PicInfo;
  876.         UndoInfo: InfoPtr;
  877.         CurrentUndoSize: LongInt;
  878.         SprayCanDiameter, SprayCanRadius, SprayCanRadius2: integer;
  879.         BrushHeight, BrushWidth: integer;
  880.         CurrentFontID, CurrentSize, NumFontItems: integer;
  881.         CurrentStyle: Style;
  882.         InsertionPoint: point; {Offscreen coordinates}
  883.         IsInsertionPoint: boolean;
  884.         TextJust: integer;
  885.         TextBack: TextBackType;
  886.         TextStr: str255;
  887.         TextRect: rect;
  888.         TextStart: point;
  889.         BlinkTime: LongInt;
  890.         pat: array[0..7] of pattern;
  891.         PatIndex: integer;
  892.         OpPending: boolean;
  893.         CurrentOp: OpType;
  894.         IsOK: boolean;
  895.         PicLeftBase, PicTopBase, PicLeft, PicTop: integer;
  896.         ClipBufInfoRec: PicInfo;
  897.         ClipBufInfo: InfoPtr;
  898.         MouseState: (NotInRoi, InRoi, DownInRoi);
  899.         osMouseDownLoc: point;
  900.         OldRoiRect: rect;
  901.         WhatsOnClip: (NothingOnClip, AColor, RectPic, NonRectPic, ImportedPic, CameraPic, TextOnClip, LivePic);
  902.         ClipTextInBuffer: boolean;
  903.         ExtraColors: ExtraColorsArray;
  904.         nExtraColors: integer;
  905.         PasteTransferMode: integer;
  906.         cheight: integer;
  907.         ExtraColorsRect: array[1..MaxExtraPlus2] of rect;
  908.         ExtraColorsEntry: array[1..MaxExtraPlus2] of integer;
  909.         RoiMode: (MoveMode, StretchMode, LeftEndMode, RightEndMode);
  910.         OldScrapCount: integer;
  911.         ClipboardConverted: boolean;
  912.         results: record
  913.                 UncalibratedMean: extended;
  914.                 MinIndex, MaxIndex, imode: integer;
  915.             end;
  916.         FrameGrabber: (QuickCapture, Scion, ScionLG3, NoFrameGrabber);
  917.         fgSlotBase: LongInt;
  918.         ControlReg, ChannelReg, BufferReg, DacHighReg, DacLowReg: ptr;
  919.         Digitizing: boolean;
  920.         debugging: boolean;
  921.         NoInfo: InfoPtr;
  922.         NoInfoRec: PicInfo;
  923.         UndoFromClip: boolean;
  924.         DensitySlicing, ThresholdToForeground, NonThresholdToBackground: boolean;
  925.         SliceStart, SliceEnd: integer;
  926.         SliceColor: RGBColor;
  927.         BlankFieldInfo: InfoPtr;
  928.         BlankFieldMean: integer;
  929.         InvertVideo, HighlightSaturatedPixels: boolean;
  930.         VideoChannel: integer;
  931.         TextBufSize, TextBufColumn, TextBufLineCount: integer;
  932.         TextBufP: TextBufPtr;
  933.         BitInfoCount: integer;
  934.         mCount, mCount2: integer;
  935.         nPoints, nLengths, nAngles: integer;
  936.         umean: array[0..MaxStandards] of real; {Uncalibrated means}
  937.         StandardValues: StandardsArray;
  938.         nStandards: integer;
  939.         cvalue: array[0..255] of extended;
  940.         MinValue, MaxValue, FitGoodness, FitSD: extended;
  941.         PlotLeftMargin, PlotTopMargin, PlotBottomMargin, PlotRightMargin: integer;
  942.         WhatToUndo: WhatToUndoType;
  943.         WhatToCopy: (NothingToCopy, CopySelection, CopyCLUT, CopyGrayMap, CopyTools, CopyPlot, CopyCalibrationPlot, CopyHistogram, CopyMeasurements, CopyColor, CopyText);
  944.         WhatToPrint: (NothingToPrint, PrintImage, PrintSelection, PrintMeasurements, PrintPlot, PrintHistogram, PrintText);
  945.         PrintRecord: THPrint;
  946.         isLaserWriter: boolean;
  947.         printing: boolean;
  948.         HalftoneFrequency, HalftoneAngle: integer;
  949.         HalftoneDotFunction: boolean;
  950.         AppleMenuH, FileMenuH, AcquireMenuH, ExportMenuH, EditMenuH, OptionsMenuH, ColorTablesMenuH, {}
  951.         PropagateMenuH, EnhanceMenuH, FilterMenuH, BinaryMenuH, ArithmeticMenuH, BackgroundMenuH, {}
  952.         AnalyzeMenuH, SpecialMenuH, StacksMenuH, SortPaletteMenuH, FontMenuH, SizeMenuH, StyleMenuH, {}
  953.         WindowsMenuH, UserMenuH, TransferModeMenuH, LineToolMenuH, ImageMathOpsMenuH, ImageListMenuH, UnitsMenuH: MenuHandle;
  954.         rleft, rtop: integer;
  955.         ListDone: boolean;
  956.         ResultsWindow: WindowPtr;
  957.         hScrollBar, vScrollBar: ControlHandle;
  958.         ListTE: TEHandle;
  959.         hListPageSize, vListPageSize: integer;
  960.         measuring: boolean;
  961.         Measurements: set of MeasurementTypes;
  962.         nListColumns: integer;
  963.         FramesToAverage: integer;
  964.         xLabel, yLabel, zLabel: string[31];
  965.         xValueLoc, yValueLoc, zValueLoc: integer;
  966.         MenuBarHeight: integer;
  967.         NewPicWidth, NewPicHeight: integer;
  968.         RestoreUndoBuf: boolean;
  969.         WhatToOpen: (OpenImage, OpenPICT2, OpenTIFF, OpenMCID, OpenUnknown, OpenImported, OpenCustom);
  970.         WhatToImport: WhatToImportType;
  971.         ImportCustomWidth, ImportCustomHeight, ImportCustomSlices: integer;
  972.         ImportCustomOffset: LongInt;
  973.         ImportCustomDepth: FileDepthType;
  974.         ImportSwapBytes, ImportAll, ImportCalibrate, ImportInvert: boolean;
  975.         IntelByteOrder: boolean;
  976.         BufferSize: LongInt;
  977.         MaxScionWidth: integer;
  978.         isSelectionTool: boolean;
  979.         SelectionMode: (NewSelection, AddSelection, SubSelection);
  980.         RoiMovementState: (Unconstrained, Constrained, ConstrainedH, ConstrainedV);
  981.         pcItem: array[1..npcItems] of record
  982.                 r: rect;
  983.                 itype: pcItemType;
  984.                 str: string[20];
  985.             end;
  986.         PictF: integer;
  987.         PictBuffer, curPictBufPtr: ptr;
  988.         BytesInPictBuffer: LongInt;
  989.         FitsInPictBuffer, RoiNudged, GrayMapReady, RedoSelection: boolean;
  990.         ThresholdingMode: (DensitySlice, GrayMapThresholding, BinaryImage, NoThresholding);
  991.         WandAutoMeasure, WandAdjustAreas, RedirectSampling: boolean;
  992.         LabelParticles, OutlineParticles, IgnoreParticlesTouchingEdge, IncludeHoles: boolean;
  993.         MinParticleSize, MaxParticleSize: LongInt;
  994.         OptionKeyWasDown, ScaleArithmetic, FitEllipse, AnalyzingParticles: boolean;
  995.         WhiteRGB, BlackRGB: RGBColor;
  996.         BinaryIterations: integer;
  997.         nMonitors: integer;
  998.         Monitors: array[1..6] of GDHandle;
  999.         ValuesMessage: str255;
  1000.         fgStartTicks, fgFrameCount: LongInt;
  1001.         SaveAsWhat: SaveAsWhatType;
  1002.         ExportAsWhat: ExportAsWhatType;
  1003.         SaveAllState: (NoSaveAll, SaveAllStage1, SaveAllStage2);
  1004.         InvertPixelValues, InvertYCoordinates, ContinuousHistogram: boolean;
  1005.         fgPort: cGrafPtr;
  1006.         fgWidth, fgHeight: integer;
  1007.         RoiUpdateTime: LongInt; {Time required to draw ROI outline. Set to 0 to force redraw.}
  1008.         FieldWidth: integer;
  1009.         Precision: integer; {Digits to right of decimal point}
  1010.         MeasurementToRedo: integer;
  1011.         Has32BitQuickDraw: boolean;
  1012.         DefaultRefNum, KernelsRefNum, MacrosRefNum: integer;
  1013.         LaunchVRefNum, PlugInsVRefNum: integer;
  1014.         LaunchDirID, PlugInsDirID: LongInt;
  1015.         DefaultFileName: string[63];
  1016.         rsHScale, rsVScale, rsAngle: real; {Rotate and Scale Parameters}
  1017.         rsMethod: rsMethodType;
  1018.         rsCreateNewWindow: boolean;
  1019.         rsInteractive: boolean;
  1020.         TextEol, TextEof: boolean;
  1021.         Textf, TextIndex: integer;
  1022.         TextFileSize: LongInt;
  1023.         nMacros, nSymbols: integer;
  1024.         pcStart, TopOfStack, CurrentX, CurrentY, EndMacros: integer;
  1025.         nProcedures, TokenLoc, TokenStackLoc, SavePC, nGlobals, SymbolTableLoc: integer;
  1026.         LegalWithoutImage: set of CommandType;
  1027.         MacroTicks: LongInt;
  1028.         SaveForeground: integer;
  1029.         PC: integer; {"program counter" used by macro interpreter}
  1030.         MacroLineNumber: integer;
  1031.         MacroStart: array[1..MaxMacros] of integer;
  1032.         MacroKey: packed array[1..MaxMacros] of char;
  1033.         Token, SaveToken: TokenType;
  1034.         TokenStr: str255;
  1035.         TokenSymbol, MacroOrProcName: SymbolType;
  1036.         TokenValue: extended;
  1037.         Macro: boolean; {True if macro is running.}
  1038.         MacrosP: MacrosPtr;
  1039.         MacroCommand: CommandType;
  1040.         SerialIn, SerialOut: integer;
  1041.         SerialBufferP: ptr;
  1042.         ImportAutoScale: boolean;
  1043.         ImportMin, ImportMax: extended;
  1044.         OscillatingMovies, DriverHalftoning: boolean;
  1045.         ExplicitPalette: PaletteHandle;
  1046.         LivePasteMode: boolean;
  1047.         ShowCount: boolean;
  1048.         PasteControlLeft, PasteControlTop: integer;
  1049.         MaxMeasurements: integer;
  1050.         mean: meanPtr;
  1051.         sd: sdPtr;
  1052.         PixelCount: PixelCountPtr;
  1053.         mArea: AreaPtr;
  1054.         mode: modePtr;
  1055.         IntegratedDensity: IntegratedDensityPtr;
  1056.         idBackground: idBackgroundPtr;
  1057.         xcenter: xcenterPtr;
  1058.         ycenter: ycenterPtr;
  1059.         MajorAxis: MajorAxisPtr;
  1060.         MinorAxis: MinorAxisPtr;
  1061.         orientation: orientationPtr;
  1062.         mMin: MinPtr;
  1063.         mMax: MaxPtr;
  1064.         plength: plengthPtr;
  1065.         User1: User1Ptr;
  1066.         User2: User2Ptr;
  1067.         ResultsLeft, ResultsTop, ResultsWidth, ResultsHeight: integer;
  1068.         UnsavedResults: boolean;
  1069.         MajorLabel, MinorLabel, User1Label, User2Label: string[9];
  1070.         OldSystem, System7: boolean;
  1071.         SystemRefNum: integer;
  1072.         ShowHeadings: boolean;
  1073.         MakingLOI: boolean;
  1074.         LOIType: (Straight, Freehand, Segmented);
  1075.         MakingStack: boolean;
  1076.         FramesWanted: integer;
  1077.         ScaleConvolutions: boolean;
  1078.         FasterBackgroundSubtraction: boolean;
  1079.         BallRadius: integer;
  1080.         DelayTicks: integer;
  1081.         CmdPeriodToStop: string[21];
  1082.         CommandKey: char;
  1083.         BinaryCount, BinaryThreshold: integer;
  1084.         ClipboardColor: rgbColor;
  1085.         InitAngle, TotalAngle, AngleInc,                 {initial, total, and incremental angles of volume rotation}
  1086.         TransparencyLower,                                   {pixels below this threshold are transparent}
  1087.         TransparencyUpper,                                   {pixels above this threshold are transparent}
  1088.         Opacity,                                                       {percentage nearest-point in a combined projection}
  1089.         DepthCueSurf,                                             {depth-cueing constant for nearest-pt component}
  1090.         DepthCueInt: integer;                                  {depth-cueing constant for other projection components}
  1091.         AxisOfRotation: AxisType;                           {project volume as it rotates about x,y,or z-axis}
  1092.         SaveProjections,                                         {if TRUE, save and close proj frames once created}
  1093.         MinProjSize: boolean;                                {if FALSE, make windows same size regardless of rotation axis}
  1094.         ProjectionMethod: ProjectionMethodType;
  1095.         MeterWindow: WindowPtr;
  1096.         xCoordinates: xCoordinatesPtr;
  1097.         yCoordinates: yCoordinatesPtr;
  1098.         nCoordinates: integer;
  1099.         CoordinatesWidth, CoordinatesHeight: integer;
  1100.         CoordinatesRoiType: RoiTypeType;
  1101.         BlankLine: LinePtr;
  1102.         SwitchLUTOnSuspend: boolean;
  1103.         SumFrames, ExternalTrigger, BlindMovieCapture, ShowIntegratedValues, FixIntegrationScale: boolean;
  1104.         IntegrationMin, IntegrationMax: LongInt;
  1105.         LG3DacHigh, LG3DacLow: integer;
  1106.         MaxLG3Frames: integer;
  1107.         VideoRateAveraging: boolean;
  1108.         VideoControl: DialogPtr;
  1109.         SyncMode: SyncModeType;
  1110.         DitherColor: boolean;
  1111.         RGBLut: (ExistingLUT, SystemLUT, CustomLUT);
  1112.         Highlight1, Highlight254: rgbColor;
  1113.         HighlightMode: boolean;
  1114.         osGDevice: GDHandle;
  1115.         OpeningPlugInWindow: boolean;
  1116.         DacAReg, DacBReg: ptr;
  1117.         LG3DacA, LG3DacB, LG3DataOut: integer;
  1118.         nAcqPlugIns, nExportPlugIns, nFilterPlugIns: integer;
  1119.         LastAcqPlugIn, LastFilterPlugIn, LastExportPlugIn, NewTitle: string[31];
  1120.         TextInfo: TextInfoPtr;
  1121.         nTextWindows: integer;
  1122.         TextWindow: array[1..MaxTextWindows] of WindowPtr;
  1123.         SearchString: string[31];
  1124.         CurrentWPtr: WindowPtr;
  1125.         CurrentKind: integer;
  1126.         ToolBits: BitMap;
  1127.         TextCreator: packed array[1..4] of char;
  1128.         CurrentMathOp: (AddMath, SubMath, MulMath, DivMath, AndMath, OrMath, XorMath, MaxMath, MinMath, CopyMath);
  1129.         MathSrc1, MathSrc2: integer;
  1130.         MathGain: real;
  1131.         MathOffset: LongInt;
  1132.         MathResult: string[31];
  1133.         PrintOptionsSet: boolean;
  1134.         APReset: boolean;
  1135.         ShowPlot: boolean;
  1136.  
  1137.  
  1138. implementation
  1139.  
  1140. end.